//
//  GMButton.m
//  GuardMan
//
//  Created by steven on 2016/12/19.
//  Copyright © 2016年 steven. All rights reserved.
//

#import "GMButton.h"

@implementation GMButton

- (id)init {
    self = [super init];
    if (self) {
        self.backgroundColor = BUTTON_ACTIVE_COLOR;
        self.layer.cornerRadius = 8;
        self.titleLabel.font = [UIFont systemFontOfSize:AUTH_FONT_SIZE];
    }
    
    return self;
}

- (void)setHighlighted:(BOOL)highlighted {
    [super setHighlighted:highlighted];
    
    if (highlighted) {
        self.backgroundColor = BUTTON_HILIGHT_COLOR;
    }
    else {
        self.backgroundColor = BUTTON_ACTIVE_COLOR;
    }
}

- (void)setEnabled:(BOOL)enabled {
    [super setEnabled:enabled];

    if (enabled) {
        self.backgroundColor = BUTTON_ACTIVE_COLOR;
    } else {
        self.backgroundColor = BUTTON_INACTIVE_COLOR;
    }
}

@end
